package day4.Exer;

import java.util.Scanner;

public class Marketest {
    public static void main(String[] args) {
        Market a = new Market();
        Scanner in = new Scanner(System.in);
        boolean flag = true;
        while (flag) {
            System.out.println("1.添加会员；2.显示会员信息；3.增加会员积分；4.积分兑换；0.退出。请选择：");
            int chosen1 = in.nextInt();
            switch (chosen1) {
                case 1: {
                    Card first=new Card();
                    Card c=first;
                    System.out.println("请选择会员卡号：");
                    first.cardNo = in.next();
                    //a.checkCardNoRepeat(a.c.cardNo);
                    System.out.println("请输入姓名：");
                    first.name = in.next();
                    System.out.println("请输入联系方式：");
                    first.phone = in.next();
                    System.out.println("请输入积分：");
                    first.point = in.nextInt();
                    a.addinfo(first);
                    break;

                }
                case 2:{
                    System.out.println("会员信息");
                    System.out.println("会员号\t会员姓名\t会员电话\t会员积分");
                        a.show();
                        break;
                }
                case 3: {
                    System.out.println("请输入会员卡号");
                    String chosenno = in.next();
                    System.out.println("请输入要增加的积分：");
                    int fen = in.nextInt();
                    a.inc(chosenno, fen);
                    break;
                }
                case 4: {
                    System.out.println("请输入会员卡号：");
                    String cardNo = in.next();
                    System.out.println("1：100分兑换餐巾纸一包；2：400分兑换剃须刀一把；3：1000分兑换炒锅一个；请选择：");
                    int chosen = in.nextInt();
                    a.exchange(cardNo, chosen);
                    break;
                }
                case 0: {
                    System.out.println("感谢使用！");
                    flag = false;
                }


            }

        }
    }
}